<% @page_title = "最新学校照片 | 多背一公斤 - 灾后学校重建计划" -%>

<% content_for :sidebar do -%>
  <h2><%= link_to "返回学校页面", :controller => '/dizhen/schools', :action => 'index' %></h2>
<% end -%>

<h1>最新上传的学校照片</h1>
<% @photos.each do |photo| -%>
  <div class="cmt-item" style="margin-bottom:10px;clear:both">
    <div style="float:left;margin:0 8px 0 0">
      <%= link_to image_tag(photo.public_filename(:small), :style=> "float:left; margin:3px"), school_url(photo.school.id), :target => '_blank' %><br />
    </div>
    <div style="margin-left:240px">
        <div>
          <h2><%= link_to photo.title, photo_url(photo.id) %></h2>
        </div>
      <div><%= link_to_user_page photo.user, :target => '_blank' %><span class="tip"> 上传了<%= link_to_school_page photo.school, :target => "_blank" %>的照片 <%= show_datetime photo.created_at %></span>
      </div>
      <div><%= photo.description_html %></div>
    </div>
  </div>
<% end -%>
<div class="clear">
  
</div>
<%= will_paginate @photos %>